package cn.melonlib.graphql.model.support;

import lombok.Data;

import java.io.Serializable;

/**
 * 分页查询包装分页信息
 */
@Data
public class PageInfo implements Serializable {

    private int page;

    private int size;

    private long offset;

    private String endCursor;

    private Boolean hasNextPage;

    public PageInfo(String endCursor, Boolean hasNextPage) {
        this.endCursor = endCursor;
        this.hasNextPage = hasNextPage;
    }

    public PageInfo(int size, long offset) {
        this.size = size;
        this.offset = offset;
    }

    public PageInfo(int page, int size) {
        this.page = page;
        this.size = size;
    }
}
